<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no" />
    <title>确认订单</title>
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../css/common.css" />
    <style>
        .aui-bar-nav{
            background-color: white;
            color: black;
        }
         body {
             background: #f3f3f3;
             font-size: 16px;
         }
        .aui-nav{
            height: auto;
        }
        .aui-icon-left {
            padding-left: 10px;
        }

        header {
            width: 100%;
            background: #fff;
            position: relative;
            z-index: 9;
        }


        .aui-iconfont {
            position: absolute;
        }


        .contents>span {
            display: block;
        }





        .haderTitle li>span {
            float: left;
            display: block;
        }
        .detail{
            overflow: hidden;
            padding:5px 15px;
        }
        .good-pirce {
            color: #ff0005;
            font-weight: bold;
        }


        .haderTitle li>span{
            float: left;
            display: block;
        }

        .contain .aui-tab-nav li{
            line-height: inherit;
            height: auto;
            position: relative;
            padding: 15px ;
            width: 100%;
        }

        .contents>span{
            display: block;
        }

        .good-pirce{
            color:#ff0005;
            font-weight: bold;
        }

        .good_bottom ul li{
            overflow: hidden;
            margin-bottom: 5px;
        }
        .good_bottom ul li span{
            display: block;
        }
        .aui-iconfont{
            margin-right: 5px;
        }
        .total .good-pirce{
            font-size: 18px;
        }
        input[type="text"]{
            margin: 0;
        }

        .aui-checkbox:checked:before, .aui-checkbox.aui-checked:before{
            top: -5px;
            left: 1px;
        }

    </style>

</head>
<body>
<header class="aui-bar aui-bar-nav aui-border-b">
    <div class="aui-pull-left aui-iconfont aui-icon-left icon-left-coler" tapmode onclick="closeWin()"></div>
    <div class="aui-title">
        确认订单
    </div>
</header>

<footer class="aui-nav " >
    <div class="showBeans   aui-padded-5-10 beansControl font-size-12 aui-border-t dispalyNone-unImportant">
        你的金豆余额为：<em class="myBeans" id="vmoney_returned">***</em>个
        <div class="aui-pull-right"><em class="shangjing-color2"><a href=""><input class="aui-checkbox aui-margin-0 aui-margin-r-5 noAfter" style="width: 19px;height:19px;" tapmode onchange="clickBeansCheckbox(this)"  type="checkbox"></a>使用金豆抵现</em></div>
    </div>
    <div class="detail aui-border-t" style="line-height: 24px;">
        <div class="aui-pull-left">
            <p class="font-size-12">商品总价:￥<em class="font-black totalMoney">***</em></p>
            <!--<p class="font-size-12">货款总计:￥6235.80</p>-->
        </div>
        <div class="aui-pull-right total">
            <p class="font-black-12">总计:<span class="good-pirce">￥<em class="payMount">***</em></span></p>
            <!--<p class="font-size-12">160种480件不含运费</p>-->
        </div>
    </div>
    <div class="myBtn" tapmode onclick="surePay()">确认付款</div>
</footer>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
<script type="text/javascript" src="../script/jquery.min.js"></script>
<script type="text/javascript">
    var goodOrderInfo="",goodId="",orderType="",count,supplierId="";
    apiready = function() {
        api.parseTapmode();
        goodOrderInfo=api.pageParam.goodOrderInfo;

        orderType=api.pageParam.orderType;
        count=api.pageParam.count;
        goodId=api.pageParam.goodId;
        var header = $api.dom('header');
        $api.fixIos7Bar(header);
        var footer = $api.dom('footer');
        api.setStatusBarStyle({
            style : 'dark'
        });
        var header_h = $api.offset(header).h;
        var footer_h = $api.offset(footer).h;
        var body_h = $api.offset($api.dom('body')).h - header_h-footer_h;
        api.openFrame({
            name : 'orderConfirmGood_frm',
            url : 'orderConfirmGood_frm.html',
            rect : {
                x : 0,
                y : header_h,
                w : 'auto',
                h : body_h
            },
            pageParam:{
                goodOrderInfo:goodOrderInfo,
                goodId: goodId,
                count: count,
                orderType: orderType
            },
            bounces : false,
            vScrollBarEnabled : false,
            hScrollBarEnabled : false
        });
//        显示总价格
        api.addEventListener({
            name:"showTotalMoney"

        },function (ret,err) {
            if(ret &&ret.value){
                $(".totalMoney").text(ret.value.totalMoney);
                $(".payMount").text(ret.value.totalMoney);
                hideLoading();
            }
        })
        getStorageAll();
        if(user_id){
            getUserInfo();
            if(vmoney_returned>0){
                $(".showBeans").show();
            }
        }

    }
    function surePay() {
        api.execScript({
            frameName:"orderConfirmGood_frm",
            script:"surePay()"
        })
    }
    //单击金豆多选款
    function clickBeansCheckbox(obj) {
        var $MyBeansParent=$(obj).closest(".beansControl");
        var myBeans=$MyBeansParent.find(".myBeans").eq(0).text();
        var goodPrice=$(".totalMoney").text();
        var payTotalMount=(goodPrice-myBeans).toFixed(2);
        if(payTotalMount<0){
            payTotalMount=0
        }
        if($(obj).prop("checked")){
            $MyBeansParent.next().find(".payMount").text(payTotalMount)
        }else{
            $MyBeansParent.next().find(".payMount").text(goodPrice)
        }
    }
</script>
</html>
